package cvsexample5;

public class Enumerations {
	
	/* Constant total value */
	public static final int NUM_PLANETS = 8;
	
	/* Create an enumeration type (Planets) that contains the following constants:
	 * MECURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE 
	 */
	public enum Planets {
		MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, URANUS, NEPTUNE
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		/* Write out a start message to the console */
		System.out.println("Example 5 - Enumerations started");
		
		/* Local variable for output string */
		String strMyPlanet = "";
		
		/* Create an enumeration constant and output the name of the associated planet
		 * as a string using multiple selection (i.e. a case statement)
		 * NOTE: the case statement should be able to process each of the planets and produce a 
		 *       string with the name of the planet that is then used to write out the name
		 */
		Planets myPlanet = Planets.MARS;
		
		switch(myPlanet) {
		case MERCURY:
			strMyPlanet = "Mercury";
			break;
		case VENUS:
			strMyPlanet = "Venus";
			break;
		case EARTH:
			strMyPlanet = "Earth";
			break;
		case MARS:
			strMyPlanet = "Mars";
			break;
		case JUPITER:
			strMyPlanet = "Jupiter";
			break;
		case SATURN:
			strMyPlanet = "Saturn";
			break;
		case URANUS:
			strMyPlanet = "Uranus";
			break;
		case NEPTUNE:
			break;
		default:
			break;
		}
		
		/* Write out the name of the current planet */
		System.out.println("The current planet is: " + strMyPlanet);
	
		/* Write out an end message to the console */
		System.out.println("Example 5 - Enumerations completed");
	}
}
